import { ColumnsRenderFun, formatDecimal, getSorter } from '@/common';

/**
 * @getProjectTableColumns 步骤条第一步 项目弹窗配置
 */
export const getProjectTableColumns = (): Record<string, any>[] => {
  return [
    {
      title: '项目编号',
      dataIndex: 'xmdm',
      key: 'xmdm',
      visible: true,
      width: 120,
      sorter: (a: any, b: any) => getSorter(a?.xmdm, b?.xmdm),
      render: (text: string) => ColumnsRenderFun({ text }),
    },
    {
      title: '项目名称',
      dataIndex: 'xmmc',
      key: 'xmmc',
      visible: true,
      width: 200,
      sorter: (a: any, b: any) => getSorter(a?.xmmc, b?.xmmc),
      render: (text: string) => ColumnsRenderFun({ text }),
    },
    {
      title: '项目费用（元）',
      dataIndex: 'ysje',
      key: 'ysje',
      visible: true,
      width: 120,
      sorter: (a: any, b: any) => getSorter(a?.ysje, b?.ysje),
      render: (text: string) => formatDecimal(text),
    },
  ];
};
